<form  method="post" id="formID"  name="test" action="">
{if $questionnoreply eq NULL}
{section name=i loop=$listquestion}
	{$listquestion[i]->getText() assign='Question'}
	<b>{$Question}</b><br/>
	{assign var=checkbox value=''}
	{if $listquestion[i]->getType() eq 1}
		{assign var=checkbox value='checkbox'}
	{else}
		{assign var=checkbox value='radio'}
	{/if}
	{section name=j loop=$listquestion[i]->getAnswers()}
		{$listquestion[i]->getAnswers() assign='Massreply'}
		{$Massreply[j]->getText() assign='textOptionReply'}
		{assign var=valueOptionReply value={$smarty.section.j.index}}
		{if $checkbox eq "radio"} 
			{assign var=num value=0}
		{else}
			{assign var=num value={$smarty.section.j.index}}
		{/if}	
		<INPUT  id="otvet{$smarty.section.i.index}" class="validate[minCheckbox[1]] checkbox"  type="{$checkbox}" name="question[{$smarty.section.i.index}][{$num}]" value="{$valueOptionReply}" {$checked}>  {$textOptionReply}<br/>	
		{/section}		
{/section}

{else}
	
{section name=i loop=$listquestion}
{assign var=QuestionLabel value=''}
	{section name=y loop=$questionnoreply}
		{if $questionnoreply[y] eq $smarty.section.i.index}
			{assign var=QuestionLabel value='<==== Need to answer this question'}
		{/if}
	{/section}
{$listquestion[i]->getText() assign='Question'}
{assign var=checkbox value=''}
{assign var=QuestionL value="$Question$QuestionLabel"}
<b>{$QuestionL}<br/></b>				
{if $listquestion[i]->getType() eq 1}
	{assign var=checkbox value='checkbox'}
{else}
	{assign var=checkbox value='radio'}
{/if}
	{section name=j loop=$listquestion[i]->getAnswers()}
			{assign var=checked value=""}
			{$listquestion[i]->getAnswers() assign='Massreply'}
			{$Massreply[j]->getText() assign='textOptionReply'}
			{assign var=valueOptionReply value={$smarty.section.j.index}}
			{if $checkbox eq 'radio'} 
				{assign var=num value=0}
			{else}
				{assign var=num value={$smarty.section.j.index}}
			{/if}
			
			{if $post.question[{$smarty.section.i.index}][{$smarty.section.j.index}] neq NULL}
				{assign var=checked value='checked'}
			{/if}
			{if $post[question][{$smarty.section.i.index}][0] neq NULL}
				{if $post[question][{$smarty.section.i.index}][0] eq {$smarty.section.j.index}}
					{assign var=checked value='checked'}
				{/if}
			{/if}
					
	<INPUT  id="otvet{$smarty.section.i.index}" class="validate[minCheckbox[1]] checkbox"  type="{$checkbox}" name="question[{$smarty.section.i.index}][{$num}]" value="{$valueOptionReply}" {$checked}>  {$textOptionReply}<br/>	
			
	{/section}
{/section}


{/if}



<input class="submit" type="submit" value="Send"/> <input type=reset value=Reset> </form>
		



